<?php 
$total = count($adc->getAdTypes());
if(($total > 1) && (!($_REQUEST['q'] != '')))
{
	$rows = 4;
	?>
    <div class="grid_16">
    <table class="adtypes" style="width: 100%;" border="0">
		<tbody>
        	<tr>
            	<td></td>
				<?php 
				$i=1;
                foreach($adc->getAdTypes() as $type)
                {
					if($type->getActive() > 0)
					{
						$link = '/adtype/'.$type->getId().'/';
						if(intval($_GET['bt']) > 0)
						{ $link .= '?bt='.intval($_GET['bt']); }
						echo '<td align="center">';
						echo '<div class="adType">';
						echo 	'<a href="'.$link.'"><img width="128" title="'.$type->getTitle().'" src="'.$type->getImageUrl().'" alt="'.$type->getTitle().'" title="'.$type->getTitle().'" /></a>';
						echo 	'<div class="center">';
						echo 	'<h3><a href="'.$link.'">'.$type->getTitle().'</a></h3>';
						echo 	'</div>';
						echo '</div>';
						echo '</td>';
						if(($i % $rows) == 0)
						{ echo '<td></td></tr><tr><td></td>'; }
						$i++;
					}
                }
                ?>
            </tr>
        </tbody>
    </table>
	<div class="v-space"></div><hr /><div class="v-space"></div>
    </div>
	<?php
}
?>